<template>
  <div class="my-taskhistory">
    <eagle-page-list
      :url="'/DangerCheckTaskDetail/GetRiskCheckDetailPageData'"
      :queryParams="queryParams"
      @bindData="bindData"
      :conditions="conditions"
      ref="eaglePageList"
    >
     <template #list>
       <eagle-cell
        style="margin-top: 10px"
        class="br-8"
        v-for="(item, index) in list"
        :key="index"
       >
        <div class="warn_item">
          <div @click="goDetail(item)">
            <div class="warn_header">
              <div>{{ index + 1 }}、隐患描述：{{ item.HiddenDangerDesc }}</div>
            </div>
            <eagle-row gutter="20" class="dep_sort">
              <eagle-col span="24">
                <img
                  src="@/assets/Images/AppIcon/icon_list_kind.png"
                  alt=""
                />所属任务：{{ item.CheckTaskName }}</eagle-col
              >
            </eagle-row>

            <eagle-row gutter="20" class="dep_sort">
              <eagle-col>
                <img
                  src="@/assets/Images/AppIcon/icon_list_type.png"
                  alt=""
                />{{
                  item.OriginType == 1
                    ? "检查表检查"
                    : item.OriginType == 2
                    ? "依据检查"
                    : "随手拍"
                }}
              </eagle-col>
            </eagle-row>

            <eagle-row class="dep_sort">
              <eagle-col span="8">
                <img
                  src="@/assets/Images/AppIcon/icon_list_user.png"
                  alt=""
                />{{ item.CreateChnName }}</eagle-col
              >
              <eagle-col span="16">
                <img
                  src="@/assets/Images/AppIcon/icon_list_date.png"
                  alt=""
                />{{ getDateTime(item.CreateDate) }}</eagle-col
              >
            </eagle-row>
          </div>
        </div>
       </eagle-cell>
     </template>
    </eagle-page-list>
  </div>
</template>

<script>
import { getDateTime } from "@/utils/getDate";

export default {
  data() {
    return {
      list: [],
      conditions: {},
      controller: "/DangerCheckTask",
      queryParams: {
        rpCode: this.$route.query.rpCode || "",
        dataType: "CheckRecord",
      },
    };
  },
  created() {
  },
  methods: {
    bindData(data) {
      this.list = [];
      if (data) {
        this.list = data;
      }
    },
    getDateTime(value) {
      return getDateTime(value);
    },
    goDetail(item) {
      this.$router.push({
        path: "/Danger/DangerCheckDetailView",
        query: { id: item.ID, type: "submited" },
      });
    },
  },
};
</script>

<style lang="less" scoped>
.van-divider {
  margin-top: 3px;
  margin-bottom: 3px;
}

.my-taskhistory {
  min-height: 100vh;
  background-color: #e8f1f8;
}

.info_search {
  padding: 10px;
  border-radius: 5px !important;
  .van-field__control {
    background-color: #ffffff !important;
  }
}

.all_dep {
  background-color: #ffffff;
}

.warn_item {
  border-radius: 5px;
  position: relative;
}
.warn_header {
  display: flex;
  justify-content: space-between;
  position: relative;
  margin-bottom: 10px;
  .warn_tag {
    position: absolute;
    right: 0;
    top: 0;
    border-radius: 26.64rem 0 0 26.64rem;
  }
}
.dep_sort {
  // display: flex;
  // flex-wrap: wrap;
  // margin-bottom: 5px;
  img {
    height: 15px;
    width: 15px;
    margin-right: 5px;
  }
}
.dep_btm {
  display: flex;
  justify-content: flex-end;
  .btm_item {
    display: flex;
    align-items: center;
    img {
      height: 15px;
      width: 15px;
      margin-right: 5px;
    }
  }
}

.choose_btm {
  display: flex;
  width: 100%;
  justify-content: space-between;
  position: fixed;
  bottom: 0;
  background-color: #fff;
  .choose_cancel {
    padding: 0 10px;
    display: flex;
    align-items: center;
    float: left;
  }
  .choose_confirm {
    float: right;
    border-radius: 0;
  }
}

.card_check {
  .info_tag {
    right: -30px;
  }
}
</style>
